package cn.exrick.xboot.modules.content.entity;

import cn.exrick.xboot.base.XbootBaseEntity;
import cn.exrick.xboot.common.constant.CommonConstant;
import cn.exrick.xboot.modules.base.entity.Permission;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.persistence.*;
import java.math.BigDecimal;
import java.util.List;


/**
 * @author Exrick
 */
@Data
@Entity
@Table(name = "hont_permission")
@TableName("hont_permission")
@ApiModel(value = "权限")
public class HontPermission extends XbootBaseEntity {

    private static final long serialVersionUID = 1L;
    @Id
    @Column(name = "id")
    private String id;

    @Column(name = "name")
    @ApiModelProperty("名称")
    private String name;

    @Column(name = "showAlways")
    @ApiModelProperty("显示")
    private Boolean showAlways = true;

    @Column(name = "level")
    @ApiModelProperty("等级")
    private Integer level;

    @Column(name = "type")
    @ApiModelProperty("类型")
    private Integer type;

    @Column(name = "title")
    @ApiModelProperty("标题")
    private String title;

    @Column(name = "path")
    @ApiModelProperty("路径")
    private String path;

    @Column(name = "component")
    @ApiModelProperty("组件")
    private String component;

    @Column(name = "icon")
    @ApiModelProperty("图标")
    private String icon;

    @Column(name = "status")
    @ApiModelProperty("status")
    private String status;

    @Column(name = "buttonType")
    @ApiModelProperty("按钮类型")
    private String buttonType;

    @Column(name = "parent_id")
    @ApiModelProperty("父级id")
    private String parentId;

    @Column(name = "description")
    @ApiModelProperty("描述")
    private String description;

    @Column(name = "sortOrder")
    @ApiModelProperty("排序")
    private BigDecimal sortOrder;

    @Column(name = "hidden")
    @ApiModelProperty("是否隐藏")
    private Boolean hidden ;

    @Column(name = "url")
    @ApiModelProperty("url")
    private String url;

    @Transient
    @ApiModelProperty("子级权限")
    private List<HontPermission> children;

    @Transient
    @ApiModelProperty("编号")
    private List<String> permTypes;

    @Transient
    @TableField(exist=false)
    @ApiModelProperty("父级名称")
    private String prentName;

    @Transient
    private Boolean expand = true;

    @Transient
    private Boolean checked = false;

    @Transient
    private Boolean selected = false;

}